<template>
	<view class="info-detail">
		<template v-if="infoData.length>0">
			<text class="title">{{infoData[0].title}}</text>
			<view class="info-item">
				<text>发表时间：{{infoData[0].add_time.slice(0,10)}}</text>
				<text>浏览：{{infoData[0].click}}</text>
			</view>
			<view id="contentText">
				<rich-text :nodes="infoData[0].content"></rich-text>
			</view>
		</template>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				infoData: []

			};
		},
		onLoad(e) {

			this.getNews(e.id)
		},

		methods: {
			async getNews(id) {
				this.infoData = await this.$myRequest({
					url: '/api/getnew/' + id
				})





			}

		}
	}
</script>

<style lang="scss" scoped>
	.info-detail {
		.title {
			display: block;
			text-align: center;
			padding-top: 15rpx;
		}

		.info-item {
			display: flex;
			padding: 20rpx;
			justify-content: space-between;
		}

		#contentText {
			width: 750rpx;
		}
	}
</style>